package cn.shop.front.service;

import cn.shop.front.entity.req.ScanTransactionBatchReq;
import cn.shop.front.entity.req.TransactionBatchReq;
import cn.shop.transcation.TransactionRecord.entity.RechargeInfoReq;
import cn.shop.transcation.TransactionRecord.entity.ScanTransactionRecord;
import cn.shop.transcation.TransactionRecord.entity.TransactionRecord;
import cn.shop.transcation.detail.entity.TransactionRecordQueryReq;
import cn.shop.transcation.order.entity.Order;
import cn.shop.transcation.rechargerecord.entity.Record;

import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 交易记录服务接口
 *
 * @author jzw
 * @since 2021-12-13 10:49:41
 */
public interface TransactionRecordService {

	/**
	 * 创建订单记录
	 *
	 * @param transactionRecord 购买信息
	 * @return 返回结果
	 * @author jzw
	 * @since 2021/12/13 11:10
	 */
	Boolean createRecord(long userId, TransactionRecord transactionRecord, HttpServletRequest request) throws InterruptedException;

	List<Order> createRecord(long userId, TransactionBatchReq record, HttpServletRequest request) throws InterruptedException;

	Object createRecord(long userId, ScanTransactionRecord record, HttpServletRequest request) throws InterruptedException;

	Object createRecord(long userId, ScanTransactionBatchReq record, HttpServletRequest request) throws InterruptedException;

	/**
	 * 充值
	 *
	 * @param rechargeInfoReq
	 * @return
	 * @author jzw
	 * @since 2022/1/11 10:31
	 */
	Object recharge(RechargeInfoReq rechargeInfoReq, HttpServletRequest request);

	Record getRecord(long id);

	/**
	 * 校验是否充值成功
	 *
	 * @param id
	 * @return
	 * @author jzw
	 * @since 2022/1/27 14:47
	 */
	boolean checkRecharge(Serializable id);

	/**
	 * 获取交易列表
	 *
	 * @param userId 用户编号
	 * @param req 查询条件
	 * @return 返回结果
	 * @author 李一涵
	 * @since 2022-02-22
	 */
	Map<String, Object> recordList(long userId, TransactionRecordQueryReq req);

	/**
	 * 获取交易列表(买入和卖出)
	 *
	 * @param userId 用户编号
	 * @param req 查询条件
	 * @return 返回结果
	 * @author 李一涵
	 * @since 2022-02-22
	 */
	Map<String, Object> recordList1(long userId, TransactionRecordQueryReq req);

	/**
	 * 获取交易列表(充值和提现)
	 *
	 * @param userId 用户编号
	 * @param req 查询条件
	 * @return 返回结果
	 * @author 李一涵
	 * @since 2022-02-22
	 */
	Map<String, Object> recordList2(long userId, TransactionRecordQueryReq req);
	/**
	 * 领取商品
	 *
	 * @param orderId 订单编号
	 * @param account 游戏绑定编号
	 * @return 返回结果
	 */
	boolean receive(long orderId, String account);

	void receive(long orderId);

	BigDecimal todayRecord(long userId);
}

